import time
import functools


def my_decorator(func):
    @functools.wraps(func)
    def wrapper(*args,**kwargs):
        print("wrapper函数开始")
        start_time = time.perf_counter()
        func(*args,**kwargs)
        end_time = time.perf_counter()
        print(f"函数运行时间：{end_time - start_time}")
        print("wrapper函数结束")
    return wrapper

@my_decorator
def welcome(*args,**kwargs):
    name,gender = args
    # if gender == "男":
    #     gender = "先生"
    # else:
    #     gender = "女士"
    gender = "男士" if gender == "男" else "女士"
    print(f"hi {name}{gender}，welcome to daxiong course")
    print(f"{name}的年龄：{kwargs['age']}")
    print(f"{name}的爱好：{kwargs['hobby']}")

welcome("Andy","男",age="18",hobby="basketball")
print(welcome.__name__) # welcome or wrapper

